fix(doctor): probe VLM Function-Calling support in check_vlm (#3066)#3088
Open
chethanuk wants to merge 3 commits into
Open
fix(doctor): probe VLM Function-Calling support in check_vlm (#3066)#3088chethanuk wants to merge 3 commits into
chethanuk wants to merge 3 commits into
Conversation
…ine#3066) check_vlm now folds in a live tool-call probe (_probe_vlm_function_calling) that verifies the configured model supports Function Calling, reported as a WARN (not a hard fail) since parse/retrieval deployments never use tools. On the non-ollama litellm path, a best-effort litellm registry lookup short-circuits the live request when it returns an explicit False. Refs volcengine#3066
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
openviking-server doctor's VLM check (check_vlm()) previously only validated that config fields were present (provider, model, api_key) — it made no API call, so it could not detect whether the configured model actually supports Function Calling (tool use). A model without Function Calling therefore passeddoctorall-green, then failed only at real tool-call time with400 code 20037 "Function call is not supported for this model.".This PR folds a live Function-Calling probe into
check_vlm(), mirroring howcheck_embedding()already probes the embedder. User-facing effect:doctornow emits a WARN (with aFix:line) when the configured VLM lacks Function Calling, surfacing the gap before it breaks the bot adapter (--with-bot) and session working-memory/extraction — both of which require tool calls. It is a WARN rather than a hard failure because pure parse/retrieval deployments never use tools, so a Function-Calling-less model is valid for them; exit code stays 0 on warnings.Related Issue
Fixes #3066
Type of Change
Changes Made
_probe_vlm_function_calling(vlm_config)inopenviking_cli/doctor.py: sends one trivial tool-call request (a 1-property function tool +"ping") through the sameVLMConfig.get_completion_async(..., tools=..., tool_choice="auto")path the bot adapter uses, bounded byasyncio.wait_for(timeout=10.0)— the exact mechanism_probe_embedding_provideruses. Returns tri-stateCheckStatus.check_vlm()wiring: the final real-providerreturn True, ...now calls the probe and returns its tuple. The codex-oauth and ollama-via-litellm early-return paths are left untouched (codex auth is already verified live; ollama Function-Calling support varies by local model)._fc_unsupported_warn) and any transient/unverifiable outcome (timeout, connection error) both returnwarnwith an actionableFix:line — never a hard fail — so retrieval/parse-only deployments are not blocked. A transient outage is reported as "probe could not complete" and is never mislabeled as a Function-Calling verdict.litellmbackend path only, a best-effortlitellm.supports_function_calling(model)lookup returns the WARN without spending a live request when it gives an explicitFalse;True, unknown-model, or any exception falls through to the live probe. No new dependency — litellm is already a VLM backend here.tests/cli/test_doctor.py): added table-driven probe coverage — probe pass, the faithful 20037 repro, phrase-only Function-Calling detection, timeout/other-error WARN, fold-into-check_vlm, config-fail skips the probe,run_doctorWARN formatting + exit 0, codex/ollama paths unchanged, litellm registry prefilter, and a transient-error-not-mislabeled assertion. ExistingTestCheckVlm/TestRunDoctorpass tests now stub the probe, mirroring the embedding-probe stubbing.Testing
I have added tests that prove my fix is effective or that my feature works
New and existing unit tests pass locally with my changes
I have tested this on the following platforms:
.venv/bin/python -m pytest tests/cli/test_doctor.py→ 70 passedruff check→ cleanmypy→ 0 net-new errors (repo has ~1000 pre-existing, non-blocking)Checklist
Additional Notes
Probe decision flow (real-provider api_key path):
flowchart TD A[check_vlm reaches real-provider api_key path] --> B{provider == litellm?} B -- yes --> C{supports_function_calling == False?} C -- yes --> W[WARN: no Function Calling] C -- "True / unknown / error" --> P[live probe] B -- no --> P P --> D{tool-call request outcome} D -- success --> OK[pass: function-calling ok] D -- "20037 / 'function call' + 'not supported'" --> W D -- "timeout / other error" --> T[WARN: probe could not complete]